<template>
    <div>
        <VoSchemaForm :model="model" :schema="schema"></VoSchemaForm>
        <div>
            <pre>{{modelJson}}</pre>
        </div>
        <div class="markdown-body">
            <CodeTpl></CodeTpl>
        </div>
    </div>
</template>

<script>
import CodeTpl from '@/views/md/sf/datePicker.md';
export default {
    components: {
        CodeTpl
    },
    data() {
        return {
            model: {},
            schema: {
                properties: {
                    name1: {
                        label: '属性',
                        widget: 'datePicker',
                        ui: {
                            placeholder: '请选择日期',
                            format: 'yyyy-MM',
                            valueFormat: 'yyyy-MM',
                            clearable: true
                        }
                    },
                    name2: {
                        label: '时间段',
                        widget: 'datePicker',
                        ui: {
                            type: 'daterange',
                            startPlaceholder: '开始日期',
                            endPlaceholder: '结束日期'
                        }
                    },
                    name3: {
                        label: '插槽',
                        widget: 'datePicker',
                        ui: {
                            type: 'daterange',
                            startPlaceholder: '开始日期',
                            endPlaceholder: '结束日期'
                        },
                        slots: {
                            'range-separator'(h) {
                                return '/'
                            }
                        }
                    }
                },
                ui: {
                    labelWidth: 100
                },
                col: {
                    span: 12
                }
            }
        }
    },
    computed: {
        modelJson() {
            return JSON.stringify(this.model, null, 4)
        }
    }
}
</script>

<style>

</style>
